﻿using System;
using TemplateFoundation.PageTypeIcons.IconHandlers;

namespace TemplateFoundation.PageTypeIcons {

    /// <summary>
    /// <para>An attribute applied to page properties to enable custom icons to appear depending on the status of the property.</para>
    /// </summary>
    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, Inherited = true, AllowMultiple = true)]
    public abstract class StatusIconAttribute : IconAttribute {

        /// <summary>
        /// <para>Initializes a new StatusIconAttribute.</para>
        /// </summary>
        /// <param name="imageUrl">The virtual path to the icon to use.</param>
        /// <param name="toolTip">The tool tip to show on mouseover.</param>
        public StatusIconAttribute(string imageUrl, string toolTip) : base(imageUrl){
            this.ToolTip = toolTip;
        }

        /// <summary>
        /// <para>The handler responsible for the logic if the icon is to be shown or not.</para>
        /// </summary>
        public IconHandlerBase Handler {
            get;
            protected set;
        }

        /// <summary>
        /// <para>The tool tip to show on mouseover.</para>
        /// </summary>
        public string ToolTip {
            get;
            private set;
        }
    }
}